/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: jse2303 - Reg1
 * <p>Powered by webrx On 2023-07-18 09:09:11
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reg1 {
    public static void main(String[] args) {
        //判断有没有汉字
        String str = "C汉要地地苛要工地hina中国-sfsfs郑州sfswww234234计算机";

        //模式类 相当于 字符串表达式。
        //Pattern pattern = Pattern.compile(".*[\\u4e00-\\u9fa5].*");

        //匹配器类
        //Matcher matcher = pattern.matcher(str);
        //判断有没有汉字
        //System.out.println(matcher.matches());

        //取出字符串中的所有汉字
        Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5]+");
        Matcher matcher = pattern.matcher(str);
        while (matcher.find()) {
            System.out.println(matcher.group());
        }

    }
}
